package com.beerandjesus.sportofkings.handicapper.dao;

import com.beerandjesus.sportofkings.handicapper.model.JockeyRating;

import java.util.List;

/**
 * Date: Jun 7, 2012
 * Time: 6:21:51 PM
 */
public interface JockeyDAO {

    /**
     * Build (or rebuild) the jockey database from scratch
     * @throws DAOException When something goes wrong
     */
    void buildDatabase() throws DAOException;

    /**
     * Get a count of rows in the jockey database
     * @throws DAOException When something goes wrong
     * @return int The row count
     */
    int getRowCount() throws DAOException;

    /**
     * Get a jockey rating record by name
     * @param name The name of the jockey
     * @return The jockey rating
     * @throws DAOException When something goes wrong
     */
    JockeyRating getJockeyRatingByName(String name) throws DAOException;

    /**
     * Save a jockey rating
     * @param rating The rating to save
     * @throws DAOException When something goes wrong
     */
    void save(JockeyRating rating) throws DAOException;

    /**
     * Get all jockey ratings
     * @return A list of all jockey ratings
     * @throws DAOException if something goes wrong
     */
    List<JockeyRating> getAllJockeyRatings() throws DAOException;

}
